package cn.edu.sdjzu;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
@EnableDiscoveryClient // 开启服务注册发现功能，不过，现在这个已经不需要了，自动配置
public class NacosApplication {
    public static void main(String[] args) {
        ConfigurableApplicationContext applicationContext = SpringApplication.run(NacosApplication.class, args);
        String user1 = applicationContext.getEnvironment().getProperty("user");
        String age = applicationContext.getEnvironment().getProperty("age");
        System.out.println("username:" + user1 + ",age:" + age);
    }
}
